﻿using System;
using System.Collections.Generic;
using ZyGames.DZPocker.Model;
using ZyGames.Framework.Cache.Generic;
using ZyGames.Framework.Game.Cache;
using ZyGames.Framework.Game.Context;
using ZyGames.Framework.Game.Contract;
using ZyGames.Framework.Game.Contract.Action;
using ZyGames.Framework.Game.Lang;
using ZyGames.Framework.Game.Service;
using System.Linq;
using ZyGames.DZPocker.Bll.Logic;
using ZyGames.DZPocker.Script;
using System.Text.RegularExpressions;

namespace ZyGames.DZPocker.Script.CsScript.Action
{
	/// <summary>
	/// 下发游客列表和实时战绩
	/// </summary>
	public class Action30071 : BaseAction
	{
		private int tableId;
		/// <summary>
		/// 游客列表,没有坐下的并且进入房间的玩家
		/// </summary>
		private string tourists;
		/// <summary>
		/// 实时战绩
		/// </summary>
		private string realTimeRecords;
		private int leftTime;
		private int hand;
		public Action30071(HttpGet actionGetter)
			: base((short)ActionType.DZShowRealTimeRecordAndTourists, actionGetter)
		{
		}
		public override bool GetUrlElement()
		{
			if (httpGet.GetInt("TableId", ref tableId) &&
				httpGet.GetInt("LeftTime", ref leftTime) &&
				httpGet.GetInt("Hand", ref hand) &&
				httpGet.GetString("Tourists", ref tourists) &&
				httpGet.GetString("RealTimeRecords", ref realTimeRecords))
			{
				return true;
			}
			return false;
		}

		public override bool TakeAction()
		{
			return true;
		}

		public override void BuildPacket()
		{
			this.PushIntoStack(this.tableId);
			this.PushIntoStack(this.leftTime);
			this.PushIntoStack(this.hand);
			this.PushIntoStack(this.tourists);
			this.PushIntoStack(this.realTimeRecords);
		}
	}
}
